package com.yunhe.device.domain.device;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.yunhe.device.model.device.EquipAnlogTypeVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.neo4j.ogm.annotation.GeneratedValue;
import org.neo4j.ogm.annotation.Id;
import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.annotation.Property;

import java.util.List;

/**
 * @ClassName Equipment
 * @Description 设备模型信息
 * @Author HeTao
 * @Date 2021/7/13 17:06
 * @Version 1.0
 **/
@ApiModel(value = "Device", description = "设备模型信息")
@NodeEntity
@Data
public class Device implements Comparable<Device>  {

    @Id
    @GeneratedValue
    private Long id;

    @Property
    private String status="03";

    @ApiModelProperty("设备名称")
    @Property
    private String equipName;

    @ApiModelProperty("归属园区")
    @Property
    private Long ownedPark;

    @ApiModelProperty("设备位置")
    @Property
    private String equipLocation;

    @ApiModelProperty("设备Sn码")
    @Property
    private String equipSN;

    @Property
    private String deviceAttributes;

    @Property
    private String devicePointNumber;

    @Property
    private Long sn;

    @Property
    private String createTime;

    @Property
    private String updateTime;

    @JsonIgnore
    private String equipTypeName;

    @JsonIgnore
    private Long equipTypeId;

    @JsonIgnore
    private String equipTypeTitle;

    @Override
    public int compareTo(Device o) {
        if (o == null) {
            return 1;
        }
        if (this.sn == null) {
            return -1;
        } else if (o.getSn() == null) {
            return 1;
        }
        return this.sn.compareTo(o.getSn());
    }


}
